//
//  TrainItemCell.m
//  Traveling
//
//  Created by 尹桥印 on 15/7/4.
//  Copyright (c) 2015年 长沙市岳麓区立早网络科技有限公司. All rights reserved.
//

#import "TrainItemCell.h"

@interface TrainItemCell()
@property (weak, nonatomic) IBOutlet UILabel *trainNoLabel;

@property (weak, nonatomic) IBOutlet UILabel *lishiLabel;

@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *startStationLabel;
@property (weak, nonatomic) IBOutlet UILabel *endStationLabel;

@property (weak, nonatomic) IBOutlet UILabel *isStartStationLabel;
@property (weak, nonatomic) IBOutlet UILabel *isEndStationLabel;

@end


@implementation TrainItemCell

+(instancetype)cellWithTabelView:(UITableView *)tableView{
    TrainItemCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TrainItemCell"];
    return cell;
}

-(void)setResult:(TrainResult *)result{
    _result = result;
    self.trainNoLabel.text = result.train_no;
    self.lishiLabel.text = result.lishi;
    self.timeLabel.text = [NSString stringWithFormat:@"%@到%@",result.start_time,result.arrive_time];
    
    if (result.is_start_station) {
        self.isStartStationLabel.text = @"始发";
    }else{
        self.isStartStationLabel.text = @"经过";
    }
    
    if (result.is_end_station) {
        self.isEndStationLabel.text = @"终点";
    }else{
        self.isEndStationLabel.text = @"经过";
    }
    self.startStationLabel.text = result.start_station;
    self.endStationLabel.text = result.end_station;
}

@end
